package com.qiandao.xuexitong.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@HeadRowHeight(20)
public class AttendanceExportVO {
    
    @ExcelProperty({"姓名"})
    @ColumnWidth(15)
    private String name;
    
    @ExcelProperty({"学号"})
    @ColumnWidth(15)
    private String stuNum;
    
    @ExcelProperty({"学校"})
    @ColumnWidth(20)
    private String school;
    
    @ExcelProperty({"院系"})
    @ColumnWidth(20)
    private String department;
    
    @ExcelProperty({"专业"})
    @ColumnWidth(20)
    private String profession;
    
    @ExcelProperty({"行政班级"})
    @ColumnWidth(15)
    private String classNum;
    
    @ExcelProperty({"签到状态"})
    @ColumnWidth(15)
    private String status;
    
    @ExcelProperty({"签到时间"})
    @ColumnWidth(20)
    private String signTime;
    
    public void setSignTime(LocalDateTime time) {
        if (time == null) {
            this.signTime = "----";
        } else {
            this.signTime = time.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        }
    }
} 